/*
 * @Author: Gaoxs
 * @Date: 2023-04-07 15:12:06
 * @LastEditors: caiwenfeng
 * @Description:
 */
import util from '@/utils';

import App from './App';

import { createPinia } from 'pinia';
import piniaPersist from 'pinia-plugin-persistedstate';
import uvUI from '@/uni_modules/uv-ui-tools';
import { initUvConfig } from '@/utils/uv-config.js';

import { createSSRApp } from 'vue';

export function createApp() {
  const app = createSSRApp(App);
  app.use(util);
  app.use(uvUI);
  initUvConfig();
  //app.use(createPinia())
  const pinia = createPinia();

  pinia.use(piniaPersist);
  app.use(pinia);
  return {
    app,
    pinia,
  };
}
